#include <iostream>
using namespace std;

class Complex {
  private:
    double realPart;
    double imagePart;

  public:
    Complex(double real = 0, double image = 0)
        : realPart(real), imagePart(image) {}
    double GetRealPart() const { return realPart; }
    double GetImagePart() const { return imagePart; }
    Complex operator+(const Complex &a) const {
        return Complex(realPart + a.realPart,
                       imagePart + a.imagePart); // 返回和
    }
};

int main() {
    Complex a(1, 2), b(2, 6), c;

    c = a + b;
    cout << "a=" << a.GetRealPart() << "+" << a.GetImagePart() << "i" << endl;
    cout << "b=" << b.GetRealPart() << "+" << b.GetImagePart() << "i" << endl;
    cout << "c=" << c.GetRealPart() << "+" << c.GetImagePart() << "i" << endl;

    return 0;
}
